<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>作品目录</title>
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="../css/iconfont.css"/>

		<script src="../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/miva.utils.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/miva.components.vue.js" type="text/javascript" charset="utf-8"></script>

		<script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>

		<link rel="stylesheet" type="text/less" href="../css/entry.less"/>
    <script src="../js/less.js" type="text/javascript" charset="utf-8"></script>

	</head>
	<body>
    <div id="app">
      <header class="mui-bar mui-bar-nav">
  			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  			<h1 class="mui-title">作品目录</h1>
  		</header>
  		<div class="mui-content">
  			<frame-work-book type="4" :book-data="bookData"></frame-work-book>

				<div>
					<div v-for="(temp, index) in chapterList" class="total-chapter">
						<i v-if="index==0" class="iconfont icon-mulu"></i><span v-if="index==0">共80章</span>
						<span v-if="index > 0">第{{index}}章: XXXXX</span>
					</div>
				</div>


  		</div>
    </div>

    <script type="text/javascript">

      new Vue({
        el: '#app',
        data: {
          bookId: mivaUtils.getBookId(window.location.search),
					bookData: [],
					chapterList: [],
        },
				components: {
					frameWorkBook: miva.frameWorkBook,
				},
				created() {
					const _this = this;
					const params = new URLSearchParams();

					params.append('novel_id', _this.bookId)

					axios.post(
						mivaUtils.baseUri + '/Mobile/Index/novelDetail',
						params,
						{'Content-Type': 'application/x-www-form-urlencoded'}
					).then(function (response) {
				    _this.bookData.push(response.data.result.novel);
				  })

					axios.post(
						mivaUtils.baseUri + '/Mobile/Index/novelChapter',
						params,
						{'Content-type': 'application/x-www-from-urlencode'}
					).then(function(res) {
						_this.chapterList = res.data.result.chapter;
					})
				},
        mounted: function() {

        },
        methods: {}
      })
    </script>
	</body>
</html>
